package com.mall.user.domain.model;

public record CategoryName(String name) {
    public CategoryName {
        //商品分类名称不能为空
        if (name == null || name.trim().isEmpty()) {
            throw new IllegalArgumentException("商品分类名称不能为空");
        }
    }

    public static CategoryName of(String name) {
        return new CategoryName(name);
    }
}
